//
//  BBApplyTypeCollectionViewCell.m
//  BearSiX
//
//  Created by BearBaby on 16/3/26.
//  Copyright © 2016年 Tom. All rights reserved.
//

#import "BBApplyTypeCollectionViewCell.h"
#define typewidth (WINSIZEWIDTH-2)/2
#define typeheight (WINSIZEWIDTH-2)/8*3
@implementation BBApplyTypeCollectionViewCell
-(UIImageView *)imageView{
    
    if (!_imageView) {
        _imageView = [[UIImageView alloc]initWithFrame:CGRectMake(typewidth/2 - typewidth/6,typeheight/5-5,typewidth/3,typewidth/3)];
        _imageView.centerX = typewidth/2;
        
    }
    return _imageView;
}
-(UILabel *)itemLabel{
    
    if (!_itemLabel) {
        _itemLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.imageView.frame), typewidth, typewidth/8)];
        _itemLabel.textAlignment = NSTextAlignmentCenter;
        _itemLabel.font = [UIFont systemFontOfSize:WINSIZEWIDTH/25];
        _itemLabel.textColor = [UIColor blackColor];
    }
    return _itemLabel;
}

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self createUI];
    }
    return self;
}
-(void)createUI{
    [self addSubview:self.imageView];
    [self addSubview:self.itemLabel];
  
}
@end
